package leetcode;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class LeetCodeMain74 {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        while (in.hasNext()){
            int num=in.nextInt();
            in.nextLine();
            List<String> list=new ArrayList<>();
            StringBuffer buffer= new StringBuffer();
            for (int i = 0; i < num; i++) {
                list.add(i,in.nextLine());
            }
            for (int i = 0; i < num; i++) {
                if (list.get(i).contains(" ")||list.get(i).contains(",")){
                    buffer.append("\""+list.get(i)+"\"");
                }else {
                    buffer.append(list.get(i));
                }if (i!=num-1){
                    buffer.append(",");
                }
            }
            System.out.println(buffer.toString());
        }
    }
    public static void main2(String[] args) {
        Scanner in =new Scanner(System.in);
        long[] dp=new long[91];
        dp[0]=1;
        dp[1]=1;
        for (int i = 2; i <= 90; i++) {
            dp[i]=dp[i-1]+dp[i-2];
        }
        while (in.hasNext()){
            int num=in.nextInt();
            System.out.println(dp[num]);
        }
    }
    public static void main1(String[] args){
        Scanner in=new Scanner(System.in);
        String str=in.nextLine();
        StringBuffer buffer=new StringBuffer();
        for(int i=0;i<str.length();i++){
            char ch=str.charAt(i);
            if(ch==' '){
                buffer.append("%20");
            }else{
                buffer.append(ch);
            }
        }
        System.out.println(buffer.toString());
    }
}
